import time

from tqdm import trange

from NanNing.common import RadarTEST, UdpClient, RadarData

if __name__ == '__main__':
    # dbm设置三个确认周期
    try:
        for _ in trange(200):
            with UdpClient() as client:
                # print(f"-----------------------------------------\n"
                #       f"send radar data")
                client.connect(RadarTEST.HOST, RadarTEST.PORT2)  # 这里用通道2，通道1流量低，会丢包
                client.set_data(RadarData.Radar1)  # SSR A6430
                client.main_send()
            time.sleep(3.99)
    except KeyboardInterrupt:
        print("---------------------------------exit----------------------------------------\n")
